<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	List allLifeInfo = (List) request.getAttribute("allLifeInfo");
	String pageStr = (String) request.getAttribute("pageStr");	
	String typeId = (String) request.getAttribute("typeId");
	int allCounts = (Integer) request.getAttribute("allCounts");
	int pageNum = (Integer) request.getAttribute("pageNum");
	int pageCount = (Integer) request.getAttribute("pageCount");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
		<meta http-equiv="cache-control" content="no-cache" />
		<meta http-equiv="expires" content="0" />
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3" />
		<meta http-equiv="description" content="This is my page" />
		<meta name="KEYWords" content="邯郸" />
		<meta name="DEscription" content="邯郸" />
		<meta name="Author" content="邯郸" />
		<meta name="Robots" content="all" />
		<meta http-equiv="windows-Target" content="_top" />
		<meta http-equiv="MSThemeCompatible" content="NO" />
		
		<script charset="utf-8" type="text/javascript"  src="js/jquery-1.2.6.min.js"></script>
		<script charset="utf-8" type="text/javascript"  src="js/jquery.form.js"></script>		
		<link href="css/list.cmb.__1335176338__.css" rel="stylesheet"
			type="text/css" />
		<title>【邯郸-生活信息网】</title>

		<style type="text/css">
A:link {
	COLOR: #0000E3;
	TEXT-DECORATION: none
}

A:visited {
	COLOR: #0000E3;
	TEXT-DECORATION: none
}

A:hover {
	COLOR: #ff3300;
	TEXT-DECORATION: underline
}
</style>

<script type="text/javascript">
//分页函数
function getLifeInfoList(pageNum) {
	window.location.href = "doLifeInfo.do?opers3=getLifeInfoList&typeId=" + <%=typeId %> + "&pageNum=" + pageNum;
}

$(document).ready(function() {
	//提交参数
	var options = {	
		   dataType:'text',		   
		   success: function(message){
		   		document.getElementById("operateMessage").innerHTML = message;		   		
		   		window.setTimeout("document.getElementById('operateMessage').innerHTML = ''; document.getElementById('Content').value = ''; document.getElementById('random').value = '';",1500);		   		
		   		$('#Submit').attr("disabled",false);
		   },
		   
		   //验证表单
		    beforeSubmit: function() {
		    	var random = $('#random').attr("value");	
				var kindId = $('#ly').attr("value");	;
				var content = $('#Content').attr("value");
				var location = $('#location').attr("value");
				var typeId = $('#typeId').attr("value");	
				//var price = $('#price').attr("value");				
				var ly = $('#ly').attr("value");
			
				if (content == '' || content == null) {
					alert('您的内容不能为空！');
					document.myform.Content.focus();
					return false;
				} else if (content.length > 60) {
					alert('信息内容超过100个字！');
					document.myform.Content.focus();
					return false;
				} else if (random == '' || random == null) {
					alert('您的验证码为空！');
					document.myform.random.focus();
					return false;
				}// else if (typeId == '2' || typeId == '5') {
					//if(isNaN(price) || price.length < 1) {
						//alert('工资/价格值不合法, 应该为数字!');
						//document.myform.price.focus();
						//return false;
					//}					
				//} 
				$('#Submit').attr("disabled",true);
		    	return true;
		    }
	};

	//提交操作
    $('#myform').ajaxForm(options);
});
</script>
	</head>
	<body>
		<div style="width: 960px; margin: 0 auto;">
			<table width=960px height=25 bgcolor=#ffffff border=0 cellspacing=0 cellpadding=2>
				<tr>
					<td align="right"
						style="color: #424242; padding-right: 10px; font-size: 12px;">
						<a href="#" style="color: #424242; font-size: 12px;"></a>
					</td>
				</tr>
			</table>
		</div>				
				<div id="GcnADId1"></div>
				<table class="choose_tab" width="100%">
					<tr>
						<td>
							<strong><font size='2'>邯郸【												
							<%if(typeId.equals("1")){%>交友/婚恋<% } %>
							<%if(typeId.equals("2")){%>求职/招聘<% } %>	
							<%if(typeId.equals("3")){%>寻人/寻友<% } %>	
							<%if(typeId.equals("4")){%>租车/拼车<% } %>
							<%if(typeId.equals("5")){%>房屋信息<% } %>	
							<%if(typeId.equals("6")){%>招聘会<% } %>	
							<%if(typeId.equals("7")){%>生活琐事<% } %>	
							<%if(typeId.equals("8")){%>同乡会<% } %>									
							】</font></strong>
							&emsp;
							<%if(!typeId.equals("6")){%>	
							<a style="TEXT-DECORATION: underline"
								href="javascript:defsendinfor();"><font>发布信息</font>
							</a>
							<% } %>
							<script language="javascript"> 
								function defsendinfor() {
									window.location.hash = "#defsendinfor";
								}
							</script>
						</td>
						<td align="right">
							<!--  <a href="index.jsp">返回首页</a>&emsp;&emsp;-->					
						</td>
					</tr>
				</table>
				<table class="list_noimg" width="100%">
					<tr>
						<td colspan="2" align="center">
							广告链接,虚位以待！
						</td>
					</tr>
				</table>
				<c:forEach var="lifeInfo" items="<%=allLifeInfo%>">
					<table class="list_noimg" width="100%">
						<tr>
							<td align="left">
							<font size="2" color="#FF0000"> 
								<c:if test="${lifeInfo.typeId == '1' }">
									<c:if test="${lifeInfo.kindId == '1' }">
										<font color="green">【&nbsp;交友&nbsp;】</font>
									</c:if>
									<c:if test="${lifeInfo.kindId == '2' }">
										<font color="red">【&nbsp;婚恋&nbsp;】</font>
									</c:if>
								</c:if> 
								<c:if test="${lifeInfo.typeId == '2' }">
									<c:if test="${lifeInfo.kindId == '1' }">
										<font color="green">【&nbsp;求职&nbsp;】</font>
									</c:if>
									<c:if test="${lifeInfo.kindId == '2' }">
										<font color="red">【&nbsp;招聘&nbsp;】</font>
									</c:if>
								</c:if>
								<c:if test="${lifeInfo.typeId == '3' }">
									<c:if test="${lifeInfo.kindId == '1' }">
										<font color="green">【&nbsp;寻人&nbsp;】</font>
									</c:if>
									<c:if test="${lifeInfo.kindId == '2' }">
										<font color="red">【&nbsp;寻友&nbsp;】</font>
									</c:if>
								</c:if> 
								<c:if test="${lifeInfo.typeId == '4' }">
									<c:if test="${lifeInfo.kindId == '1' }">
										<font color="green">【&nbsp;租车&nbsp;】</font>
									</c:if>
									<c:if test="${lifeInfo.kindId == '2' }">
										<font color="red">【&nbsp;拼车&nbsp;】</font>
									</c:if>
								</c:if> 
								<c:if test="${lifeInfo.typeId == '5' }">
									<c:if test="${lifeInfo.kindId == '1' }">
										<font color="green">【&nbsp;中&emsp;介&nbsp;】</font>
									</c:if>
									<c:if test="${lifeInfo.kindId == '2' }">
										<font color="red">【&nbsp;非中介&nbsp;】</font>
									</c:if>
								</c:if> 
								<c:if test="${lifeInfo.typeId == '6' }">
									<font color="green">【招聘会】</font>
								</c:if>
								<c:if test="${lifeInfo.typeId == '7' }">
									<font color="green">【 生活琐事】</font>
								</c:if>
								<c:if test="${lifeInfo.typeId == '8' }">
									<font color="green">【同乡会】</font>
								</c:if>  
							</font>
							<%if(typeId.equals("6")){%>
								<a href="showZhaoPinHuiDetail.jsp?id=${lifeInfo.id}" target="_blank"><font class="list_title">${lifeInfo.content}</font></a>
							<% } else{%>
								<font class="list_title">${lifeInfo.content}</font>
							<% }%>
														
							<span onclick="event.cancelBubble=true;" class="list_word"><a
								class="adds">${lifeInfo.location}</a> </span>
							</td>
							<td align="right">
								<%if(typeId.equals("2") || typeId.equals("5")){%>
									<c:choose>
										<c:when test="${lifeInfo.price == '面议' }">
											<strong><font color='red'>${lifeInfo.price}</font></strong>
										</c:when>
										<c:when test="${lifeInfo.price == '0' }">
											<strong><font color='red'>面议</font></strong>
										</c:when>
										<c:otherwise>
											<strong><font color='red'>${lifeInfo.price}  元</font></strong>
										</c:otherwise>
									</c:choose>																		
								<% } %>
								&nbsp;&nbsp;&nbsp; ${lifeInfo.subDate} 								
							</td>
						</tr>
					</table>
			  </c:forEach>

				<div style="" id="ad_container_link">
					<ul class="list-ads3">
						<li>
							广告链接,虚位以待！
						</li>
					</ul>
				</div>
				<div class="fenye">
					<ul class="pageLink">
						<li>
							<%=pageStr%>
						</li>
					</ul>
				</div>
				<div align="center">
					<ul>
						<li>
							<font size="2" color="blue">共 <%=pageCount %> 页&nbsp;当前第 &nbsp;<%=pageNum %>/<%=pageCount %>&nbsp;页&nbsp;总记录数&nbsp;<%=allCounts %></font>
						</li>
					</ul>
				</div>
				
				<%if(!typeId.equals("6")){%>	
					<h1>
						<a id="defsendinfor" name="defsendinfor"><font color="#296fcf">发布信息</font>
						</a>
					</h1>
					<form id="myform" name="myform" action="AjaxOperateSaveLifeInfoServlet" method="post">
					<table width="980px" border="0" cellspacing="0" cellpadding="0">
					<tr bgcolor="#e0e0e0">
						<td>
							<table width="980px" border="0" cellspacing="1" cellpadding="7">
								<tbody>
									<tr>
										<td colspan="2" height="30" bgcolor="#ffffff">
											&nbsp;&nbsp;请选信息来源：
											<%if(typeId.equals("1")){%>
												<input name="ly" id="ly"  value="1" type="radio" checked="checked">	
												交友&nbsp;&nbsp;&nbsp;&nbsp;
												<input name="ly" id="ly"  value="2" type="radio">
												征婚&nbsp;
											<% } %>
											<%if(typeId.equals("2")){%>
												<input name="ly" id="ly"  value="1" type="radio" checked="checked">	
												求职&nbsp;&nbsp;&nbsp;&nbsp;
												<input name="ly" id="ly"  value="2" type="radio">
												招聘&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          						工资：<input name="price" id="price">元/月
											<% } %>
											<%if(typeId.equals("3")){%>
												<input name="ly" id="ly"  value="1" type="radio" checked="checked">	
												寻人&nbsp;&nbsp;&nbsp;&nbsp;
												<input name="ly" id="ly"  value="2" type="radio">
												寻友&nbsp;
											<% } %>
											<%if(typeId.equals("4")){%>
												<input name="ly" id="ly"  value="1" type="radio" checked="checked">	
												租车&nbsp;&nbsp;&nbsp;&nbsp;
												<input name="ly" id="ly"  value="2" type="radio">
												拼车&nbsp;
											<% } %>
											<%if(typeId.equals("5")){%>
												<input name="ly" id="ly"  value="1" type="radio" checked="checked">	
												中介&nbsp;&nbsp;&nbsp;&nbsp;
												<input name="ly" id="ly"  value="2" type="radio">
												非中介&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          						价格：<input name="price" id="price">元/月
											<% } %>
											 地区：
											<select name="location" id="location">
												<option value="邯郸市">
													邯郸市
												</option>
												<option value="丛台区">
													丛台区
												</option>
												<option value="邯山区">
													邯山区
												</option>
												<option value="复兴区">
													复兴区
												</option>
												<option value="峰峰矿区">
													峰峰矿区
												</option>
												<option value="高开区">
													高开区
												</option>
												<option value="武安市">
													武安市
												</option>
												<option value="邯郸县">
													邯郸县
												</option>
												<option value="临漳县">
													临漳县
												</option>
												<option value="成安县">
													成安县
												</option>
												<option value="大名县">
													大名县
												</option>
												<option value="涉县">
													涉县
												</option>
												<option value="磁县">
													磁县
												</option>
												<option value="肥乡县">
													肥乡县
												</option>
												<option value="永年县">
													永年县
												</option>
												<option value="邱县">
													邱县
												</option>
												<option value="鸡泽县">
													鸡泽县
												</option>
												<option value="广平县">
													广平县
												</option>
												<option value="馆陶县">
													馆陶县
												</option>
												<option value="魏县">
													魏县
												</option>
												<option value="曲周县">
													曲周县
												</option>
											</select>
											<font color="#FF0000">&nbsp;&nbsp; <span
												style="font-weight: 700; background-color: #FFFF00">&nbsp;
													注意：填写虚假信息，永久封杀！</span> </font>
										</td>
									</tr>

									<tr>
										<td width="152" height="88" bgcolor="#ffffff" align="center">
											<span> 内容</span>：
										</td>
										<td class="zi_hei_12_21" width="1800px" bgcolor="#ffffff" align="left">
											&nbsp;
											<textarea id="Content" name="Content" rows="4" cols="60"></textarea>											
											<div id="body_length" align="center"> &nbsp;
												<font color="#ff0000">&nbsp;注意：最多可输入100个汉字</font>
											</div>
										</td>
									</tr>

									<tr>
										<td class="zi14_black_xi" align="center" height="53"
											bgcolor="#FFFFFF" align="center">
											验证码：
										</td>
										<td class="zi_hei_12_21" bgcolor="#f1f3f5" align="left">
											<table id="table24" width="100%" height="50" border="0"
												cellpadding="0" cellspacing="0">
												<tbody>
													<tr>
														<td class="zi_hei_12_21" width="32%" height="19" bgcolor="#FFFFFF"> &nbsp;															
															<input type="text" name="random" id="random" size="12">
															<input type="hidden" name="typeId" id="typeId" value="<%=typeId %>">
															
															<img id="xMan" src="imgcode" onclick="javascript:changeOne();"></img>
																<a href="javascript:changeOne();">换一张</a>
																<script type="text/javascript">
																	function changeOne(){	
																		//$('#xMan').attr('src','imgcode');
																		document.getElementById("xMan").src="imgcode?"+Math.random();
																	}
																</script>
														</td>
													</tr>
												</tbody>
											</table>
									</tr>
									<tr bgcolor="#FFFFFF" align="center">
										<td colspan="2" style="font-size: 12px;" align="center" height="50">
											<span id="operateMessage"></span><br/>
											<input class="sub_1" value="马上发布" name="Submit" type="submit" id="Submit">
										</td>
									</tr>
							</table>
						</td>
					</tr>
				</table>
				</form>
			<% } %>
	</body>
</html>
